﻿using System;
using Sirenix.OdinInspector;
using UnityEngine;

namespace g_gongjianta
{
    public partial class TblSkill
    {
        public abstract class SkillEvt
        {
            [HorizontalGroup("row0")]
            public int EvtId;

            [HorizontalGroup("row0")]
            public int StartFrame;
        }

        [Serializable]
        public class SoundEvt : SkillEvt
        {
            [Tooltip("是否脚本声")]
            public bool IsFootstep;

            public EAudio Audio;
            public float Time;
            public float Volume = 1;
        }

        [Serializable]
        public class EffectEvt : SkillEvt
        {
            public string ResPath;
        }

        [Serializable]
        public class MoveEvt : SkillEvt
        {
            [HorizontalGroup("row1")]
            public int Duration;

            /// <summary>
            /// 0：朝目标点移动
            /// </summary>
            [HorizontalGroup("row1")]
            public int Type;

            [HorizontalGroup("row1")]
            public float Speed;

            //public float Limit;

            ///// <summary>
            ///// 穿过类型
            ///// 0：无法穿透怪物
            ///// 1：可以穿透怪物
            ///// </summary>
            //public int PassType;

            ///// <summary>
            ///// 初始朝向
            ///// </summary>
            //public Dir Dir;
        }

        [Serializable]
        public class BulletEvt : SkillEvt
        {
            [HorizontalGroup("row1")]
            public int Duration;

            /// <summary>
            /// 移动类型
            /// 
            /// 0：静止
            /// 1：直线
            /// 2：抛物线
            /// 3：跟随目标
            /// </summary>
            [HorizontalGroup("row1")]
            public int MoveType;


            /// <summary>
            /// 生命类型
            /// 
            /// 0:生命结束，无其他结束方式
            /// 1:技能结束
            /// 2:命中目标或接触地表
            /// </summary>
            [HorizontalGroup("row1")]
            public int LifeType;

            /// <summary>
            /// 目标类型
            /// 0：怪物，
            /// 1：动物
            /// 2：农作物，
            /// 3：地块
            /// 4：矿物
            /// 5：树木
            /// </summary>
            [HorizontalGroup("row1")]
            public int TargetType;

            [HorizontalGroup("row2")]
            public Sprite Icon;

            // [HorizontalGroup("row2")]
            // public Vector2 Size;
            //
            // [HorizontalGroup("row2")]
            // public Vector2 Offset;
            
            /// <summary>
            /// 检测类型
            /// 
            /// </summary>
            public Detech Detech;

            // /// <summary>
            // /// 运动偏移
            // /// </summary>
            // public Offset Offset;
            //public float OffsetDis;
            //public float OffsetAngle;
            //public float Radius;
        }
        //
        // [Serializable]
        // public class ActionEvt : SkillEvt
        // {
        //     //public int Duration;
        //     public string key;
        //     public int Value;
        // }
    }
}